<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base data-ice="baseUrl" href="../">
  <title data-ice="title">Function | API Document</title>
  <link type="text/css" rel="stylesheet" href="css/style.css">
  <link type="text/css" rel="stylesheet" href="css/prettify-tomorrow.css">
  <script src="script/prettify/prettify.js"></script>
  
  
  <script src="script/manual.js"></script>
</head>
<body class="layout-container" data-ice="rootContainer">

<header>
  <a href="./">Home</a>
  
  <a href="identifiers.html">Reference</a>
  <a href="source.html">Source</a>
  
  <a data-ice="repoURL" href="https://git.oschina.net/kinuxroot/unique-model.js.git">Repository</a>
  <div class="search-box">
  <span>
    <img src="./image/search.png">
    <span class="search-input-edge"></span><input class="search-input"><span class="search-input-edge"></span>
  </span>
    <ul class="search-result"></ul>
  </div>
</header>

<nav class="navigation" data-ice="nav"><div>
  <ul>
    
  <li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/session.js~Session.html">Session</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createSession">createSession</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-enablePersist">enablePersist</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-isPersistEnabled">isPersistEnabled</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-BaseModel">BaseModel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-Types">Types</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-model">model</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">backend</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/backend/base.js~Dao.html">Dao</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/backend/base.js~Session.html">Session</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">model</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/model/base.js~Model.html">Model</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-createModel">createModel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-getModel">getModel</a></span></span></li>
<li data-ice="doc"><div data-ice="dirPath" class="nav-dir-path">type</div><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~BaseType.html">BaseType</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~Double.html">Double</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~Integer.html">Integer</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~Text.html">Text</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-class">C</span><span data-ice="name"><span><a href="class/lib/type/index.js~UObject.html">UObject</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-defineType">defineType</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-function">F</span><span data-ice="name"><span><a href="function/index.html#static-function-toUniqueModel">toUniqueModel</a></span></span></li>
<li data-ice="doc"><span data-ice="kind" class="kind-variable">V</span><span data-ice="name"><span><a href="variable/index.html#static-variable-allTypes">allTypes</a></span></span></li>
</ul>
</div>
</nav>

<div class="content" data-ice="content"><h1 data-ice="title">Function</h1>
<div data-ice="summaries"><table class="summary" data-ice="summary">
  <thead><tr><td data-ice="title" colspan="3">Static Public Summary</td></tr></thead>
  <tbody>
  
  <tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="function/index.html#static-function-createModel">createModel</a></span></span><span data-ice="signature">(modelName: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>, schema: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>): <span>class</span>&lt;<span>mode/base/Model</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Create the UniqueModel class from schema</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="function/index.html#static-function-createSession">createSession</a></span></span><span data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="class/lib/backend/base.js~Session.html">Session</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Create the persistent session for unique model.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="function/index.html#static-function-defineType">defineType</a></span></span><span data-ice="signature">(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>): <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">function</a></span><span>(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>)</span>: <span><a href="class/lib/type/index.js~BaseType.html">BaseType</a></span></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Generate the function to define type.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="function/index.html#static-function-enablePersist">enablePersist</a></span></span><span data-ice="signature">()</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Enable persistent module for unique model.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="function/index.html#static-function-getModel">getModel</a></span></span><span data-ice="signature">(modelName: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>): <span>class</span>&lt;<span>model/base/Model</span>&gt;</span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Get the registered model by model name.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="function/index.html#static-function-isPersistEnabled">isPersistEnabled</a></span></span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Check whether the persistent is enabled for unique model.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
<tr data-ice="target">
    <td>
      <span class="access" data-ice="access">public</span>
      
      
      
      <span class="override" data-ice="override"></span>
    </td>
    <td>
      <div>
        <p>
           <span data-ice="name"><span><a href="function/index.html#static-function-toUniqueModel">toUniqueModel</a></span></span><span data-ice="signature">(uniqueModel: <span>class</span>&lt;<span>model/base/Model</span>&gt;, objectToCopy: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, uniqueModelObject: <span>model/base/Model</span>): <span>model/base/Model</span></span>
        </p>
      </div>
      <div>
        
        
        <div data-ice="description"><p>Convert the JavaScript object to unique object.</p>
</div>
      </div>
    </td>
    <td>
      
      
    </td>
  </tr>
</tbody>
</table>
</div>
<div data-ice="details"><h2 data-ice="title">Static Public </h2>

<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-function-createModel">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">createModel</span><span data-ice="signature">(modelName: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>, schema: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>): <span>class</span>&lt;<span>mode/base/Model</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/model/index.js.html#lineNumber53">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Create the UniqueModel class from schema</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">modelName</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The name of model.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">schema</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The schema of model.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span>class</span>&lt;<span>mode/base/Model</span>&gt;</td>
        <td class="return-desc" data-ice="returnDescription"><p>The model created according to the schema.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let Image = um.model.createModel(&apos;Image&apos;, {
    path: Types.Text(),
    type: Types.Text(),
    width: Types.Integer(),
    height: Types.Integer()
});

let User = um.model.createModel(&apos;User&apos;, {
    name: Types.Text(),
    age: Types.Integer(),
    height: Types.Double(),
    weight: Types.Double(),
    photo: Types.UObject({
        type: &apos;Image&apos;
    })
});</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-function-createSession">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">createSession</span><span data-ice="signature">(options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>): <span><a href="class/lib/backend/base.js~Session.html">Session</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/index.js.html#lineNumber92">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Create the persistent session for unique model.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">options</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The options of session</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.backend</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The backend name</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.uri</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The uri passed to backend</p>
</td>
    </tr>
<tr data-ice="property" data-depth="1">
      <td data-ice="name" data-depth="1">options.options</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The other options passed to backend</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span><a href="class/lib/backend/base.js~Session.html">Session</a></span></td>
        <td class="return-desc" data-ice="returnDescription"><p>The persistent session object.
                     Return null if the persistent module is disabled.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">um.enablePersist();
let session = um.createSession({
    backend: &apos;mongodb&apos;,
    uri: &apos;mongodb://localhost/userman&apos;,
    options: {
        user: &apos;user&apos;,
        pass: &apos;123456&apos;
    }
});</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-function-defineType">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">defineType</span><span data-ice="signature">(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>): <span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">function</a></span><span>(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>)</span>: <span><a href="class/lib/type/index.js~BaseType.html">BaseType</a></span></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/type/index.js.html#lineNumber296">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Generate the function to define type.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">name</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The name of type.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function">function</a></span><span>(name: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>, options: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>)</span>: <span><a href="class/lib/type/index.js~BaseType.html">BaseType</a></span></span></td>
        <td class="return-desc" data-ice="returnDescription"><p>The function to create type object.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-function-enablePersist">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">enablePersist</span><span data-ice="signature">()</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/index.js.html#lineNumber45">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Enable persistent module for unique model.</p>
</div>

  

  <div data-ice="properties">
</div>

  

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">enablePersist();</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-function-getModel">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">getModel</span><span data-ice="signature">(modelName: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span>): <span>class</span>&lt;<span>model/base/Model</span>&gt;</span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/model/index.js.html#lineNumber21">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Get the registered model by model name.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">modelName</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">String</a></span></td>
      <td data-ice="appendix"></td>
      <td data-ice="description"><p>The name of model</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span>class</span>&lt;<span>model/base/Model</span>&gt;</td>
        <td class="return-desc" data-ice="returnDescription"><p>The model whose name is matched with argument.
                     Return undefined if the model name is not registered.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let User = um.model.getModel(&apos;User&apos;);</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-function-isPersistEnabled">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">isPersistEnabled</span><span data-ice="signature">(): <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/index.js.html#lineNumber64">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Check whether the persistent is enabled for unique model.</p>
</div>

  

  <div data-ice="properties">
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></span></td>
        <td class="return-desc" data-ice="returnDescription"><p>The status of persistent module.
                     Return true if the persistent module is enabled.
                     Return false if the persistent module is disabled.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  <div data-ice="example">
    <h4>Example:</h4>
    
  <div class="example-doc" data-ice="exampleDoc">
      
      <pre class="prettyprint source-code"><code data-ice="exampleCode">let result = isPersistEnabled(); 
if ( result ) {
   console.log(&apos;The persistent module is enabled&apos;);
}</code></pre>
    </div>
</div>

  

  
  
</div>
<div class="detail" data-ice="detail">
  <h3 data-ice="anchor" id="static-function-toUniqueModel">
    <span class="access" data-ice="access">public</span>
    
    
    
    
    <span data-ice="name">toUniqueModel</span><span data-ice="signature">(uniqueModel: <span>class</span>&lt;<span>model/base/Model</span>&gt;, objectToCopy: <span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span>, uniqueModelObject: <span>model/base/Model</span>): <span>model/base/Model</span></span>
    <span class="right-info">
      
      
      <span data-ice="source"><span><a href="file/lib/type/index.js.html#lineNumber269">source</a></span></span>
    </span>
  </h3>

  
  
  
  <div data-ice="description"><p>Convert the JavaScript object to unique object.
If you pass a UniqueModel object, it will replace the attributes in the object.
Or the function will create a new UniqueModel object.</p>
</div>

  

  <div data-ice="properties"><div data-ice="properties">
  <h4 data-ice="title">Params:</h4>
  <table class="params">
    <thead>
    <tr><td>Name</td><td>Type</td><td>Attribute</td><td>Description</td></tr>
    </thead>
    <tbody>
    
    <tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">uniqueModel</td>
      <td data-ice="type"><span>class</span>&lt;<span>model/base/Model</span>&gt;</td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The UniqueModel type.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">objectToCopy</td>
      <td data-ice="type"><span><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a></span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The JavaScript object.</p>
</td>
    </tr>
<tr data-ice="property" data-depth="0">
      <td data-ice="name" data-depth="0">uniqueModelObject</td>
      <td data-ice="type"><span>model/base/Model</span></td>
      <td data-ice="appendix"><ul><li>optional</li></ul></td>
      <td data-ice="description"><p>The UniqueModel object.</p>
</td>
    </tr>
</tbody>
  </table>
</div>
</div>

  <div class="return-params" data-ice="returnParams">
    <h4>Return:</h4>
    <table>
      <tr>
        <td class="return-type" data-ice="returnType"><span>model/base/Model</span></td>
        <td class="return-desc" data-ice="returnDescription"><p>The UniqueModel object.</p>
</td>
      </tr>
    </table>
    <div data-ice="returnProperties">
</div>
  </div>

  

  

  

  

  

  
  
</div>
</div>
</div>

<footer class="footer">
  Generated by <a href="https://esdoc.org">ESDoc<span data-ice="esdocVersion">(0.4.3)</span></a>
</footer>

<script src="script/search_index.js"></script>
<script src="script/search.js"></script>
<script src="script/pretty-print.js"></script>
<script src="script/inherited-summary.js"></script>
<script src="script/test-summary.js"></script>
<script src="script/inner-link.js"></script>
<script src="script/patch-for-local.js"></script>
</body>
</html>
